params=commandArgs(TRUE);
name=params[1];
t=read.table(name, sep="=");
var_names=t[[1]];
var_values=t[[2]];

support_threshold=var_values[which(var_names=="support_threshold")];
mining_time=var_values[which(var_names=="mining_time")];
frequent_subtrees_count=var_values[which(var_names=="frequent_subtrees_count")];
max_freq_subtrees_count=var_values[which(var_names=="max_freq_subtrees_count")];
max_freq_subgraphs_count=var_values[which(var_names=="max_freq_subgraphs_count")];

###########

png(paste(name, "_plot_st_fst.png", sep=""));
plot(x=support_threshold, xlab="Support treshold", y=frequent_subtrees_count, ylab="Number of frequent subtrees", type="l");
dev.off();

png(paste(name, "_plot_st_mfst.png", sep=""));
plot(x=support_threshold, xlab="Support treshold", y=max_freq_subtrees_count, ylab="Number of maximal frequent subtrees", type="l");
dev.off();

png(paste(name, "_plot_st_mfsg.png", sep=""));
plot(x=support_threshold, xlab="Support treshold", y=max_freq_subgraphs_count, ylab="Number of maximal frequent subgraphs", type="l");
dev.off();

png(paste(name, "_plot_st_t-fst.png", sep=""));
plot(x=support_threshold, xlab="Support treshold", y=mining_time/frequent_subtrees_count, ylab="Time per frequent subtree", type="l");
dev.off();

png(paste(name, "_plot_st_t.png", sep=""));
plot(x=support_threshold, xlab="Support treshold", y=mining_time, ylab="Time", type="l");
dev.off();

###########

png(paste(name, "_plot_fst_t.png", sep=""));
plot(x=frequent_subtrees_count, y=mining_time);
dev.off();

png(paste(name, "_plot_fst_mfst.png", sep=""));
plot(x=frequent_subtrees_count, y=max_freq_subtrees_count);
dev.off();

png(paste(name, "_plot_fst_mfsg.png", sep=""));
plot(x=frequent_subtrees_count, y=max_freq_subgraphs_count);
dev.off();

png(paste(name, "_plot_mfst_mfsg.png", sep=""));
plot(x=max_freq_subtrees_count, y=max_freq_subgraphs_count);
dev.off();